<template>
  <div class="project">
    <div id="container"></div>
    <div class="chart">
      <div id="chart1" style="width: 300px;height: 50%;"></div>
      <div id="chart3" style="width: 300px;height: 50%"></div>
    </div>
    <div class="chart_left">
      <div id="chart2" style="width: 300px;height:  50%"></div>
      <div id="chart4" style="width: 300px;height:  50%"></div>
    </div>
    <t-dialog :showOverlay="false" :visible.sync="visible" draggable :closeOnOverlayClick="true" :confirmBtn="null" :cancelBtn="null"
              mode="modeless" header="项目列表" width="40%" height="50%" :zIndex="20000">
      <div class="projectList">
        <div class="projectList_top">
          <span>项目名称：</span>
          <span>公司名称：</span>
           <span style="text-align: center">项目负责人：</span>
        </div>
        <div class="projectList_center" v-for="item in tempProjects">
          <span>{{item.projectName}}</span>
          <span>{{item.declareDeptName}}</span>
          <span style="text-align: center">{{item.projectLeaderName}}</span>
          <!-- <span><t-button>详情</t-button></span> -->
        </div>
      </div>

    </t-dialog>
  </div>

</template>

<script>
import * as echarts from 'echarts';
// import AMapLoader from '@amap/amap-jsapi-loader';
import request from '@/utils/request'

export default {
  name: "project-map",
  data() {
    return {
      map: null,
      marker: '',
      visible: false,
      option2:{},
      mapByYear:{},
      allFunding:{},
      queryParams: {
        limit:1000000,
      },
      projectData:{},
      allProjectType:[],
      allProjectCategory:[],
      localName:[],
      tempProjects:[]
    }
  },
  async mounted() {

    // 鹰潭：117.050277,28.296579
    // 赣州：114.945682,25.829583
    // 吉安：114.980967,27.123071
    // 宜春：114.407462,27.827245
    // 萍乡：113.892544,27.6619376
    // 高德地图秘钥设置
    window._AMapSecurityConfig = {
      securityJsCode: 'ca54d4345b1bb9c8dfb4006d7b889fc9' // 密钥
    }
    // request({
    //   url:"https://restapi.amap.com/v3/geocode/geo?address=南昌市&output=XML&key=e96643d4502e063749886dc0cd6cbedc",
    //   method:'get'
    // }).then(respones=>{
    //   console.log("123")
    //   console.log(respones)
    // })
    // DOM初始化完成进行地图初始化
    this.initMap();
    await Promise.all([this.getMapByYear(),this.getAllFunding(),this.getAllProjectType(),this.getAllProjectCategory()])
    this.getProjectList()
    // 初始化图表
    this.myEcharts();

  },
  methods: {
    myEcharts() {
      const myChart = echarts.init(document.getElementById('chart1'));
      // 经费总合
      const option = {
        grid: {
          show: true,                                 // 是否显示图表背景网格
          left: '5%',                                    // 图表距离容器左侧多少距离
          right: '5%',                                // 图表距离容器右侧侧多少距离
          bottom: '3%',                              // 图表距离容器上面多少距离
          top: '10%',                                       // 图表距离容器下面多少距离
          containLabel: true,                     // 防止标签溢出
        },
        title: {
          text: '经费总合',
          textStyle: {
            color: '#ffffff'
          }
        },
        tooltip: {},
        xAxis: {
          data:this.allFunding.xAxis,
          axisLabel: {
            show: true,
            textStyle: {
              color: '#ffffff'
            }
          }
        },
        yAxis: {

        },
        series: [{
          type: 'bar',
          data:this.allFunding.yAxis
        }]
      };
      myChart.setOption(option);
      console.log(this.allFunding.xAxis)
      const myChart2 = echarts.init(document.getElementById('chart2'));
      // 年度申报总数
      this.option2 = {
        title: {
          text: '年度申报总数',
          textStyle: {
            color: '#ffffff'
          }
        },
        xAxis: {
          type: 'category',
          data: this.mapByYear.xAxis.data,
          axisLabel: {
            show: true,
            textStyle: {
              color: '#ffffff'
            }
          }
        },
        yAxis: {
          type: 'value',
          axisLabel: {
            show: true,
            textStyle: {
              color: '#ffffff'
            }
          }
        },
        series: [
          {
            data: this.mapByYear.series[0].data,
            type: 'line'
          }
        ]
      };
      myChart2.setOption(this.option2);

      const myChart3 = echarts.init(document.getElementById('chart3'))
      // 计划类别
      const option3 = {
        title: {
          text: '计划类别',
          textStyle: {
            color: '#ffffff'
          }
        },
        tooltip: {
          trigger: 'item'
        },
        // legend: {
        //   top: '10%',
        //   left: 'center',
        //   textStyle: {
        //     color: '#ffffff'
        //   }
        // },
        series: [
          {
            name: '计划类别',
            type: 'pie',
            radius: ['40%', '70%'],
            avoidLabelOverlap: false,
            itemStyle: {
              borderRadius: 10,
              borderColor: '#fff',
              borderWidth: 2
            },
            label: {
              show: false,
              position: 'center'
            },
            emphasis: {
              label: {
                show: true,
                fontSize: 20,
                fontWeight: 'bold'
              }
            },
            labelLine: {
              show: false
            },
            data: this.allProjectType
            // [
            // { value: 108, name: '项目1' },
            // { value: 73, name: '项目2' },
            // { value: 18, name: '项目3' },
            // { value: 731, name: '项目4' },
            // ]
          }
        ]
      };
      myChart3.setOption(option3);
      // 计划类别
      const myChart4 = echarts.init(document.getElementById('chart4'));
      const option4 = {
        title: {
          text: '计划类别',
          textStyle: {
            color: '#ffffff'
          }
        },
        tooltip: {
          trigger: 'item',

        },
        // legend: {
        //   top: '10%',
        //   left: 'center',
        //   textStyle: {
        //     color: '#ffffff'
        //   }
        // },
        series: [
          {
            name: '计划类别',
            type: 'pie',
            radius: ['40%', '70%'],
            avoidLabelOverlap: false,
            itemStyle: {
              borderRadius: 10,
              borderColor: '#fff',
              borderWidth: 2
            },
            label: {
              show: false,
              position: 'center'
            },
            emphasis: {
              label: {
                show: true,
                fontSize: 40,
                fontWeight: 'bold'
              }
            },
            labelLine: {
              show: false
            },
            data: this.allProjectCategory
            //   [
            //   { value: 1048, name: '计划1' },
            //   { value: 735, name: '计划2' },
            // ]
          }
        ]
      };
      myChart4.setOption(option4);
      window.addEventListener('resize', () => {
        myChart.resize();
        myChart2.resize();
        myChart3.resize();
        myChart4.resize();
      });
    },
    initMap() {
      // AMapLoader.load({
      //   key: "e96643d4502e063749886dc0cd6cbedc",             // 申请好的Web端开发者Key，首次调用 load 时必填
      //   version: "2.0",      // 指定要加载的 JSAPI 的版本，缺省时默认为 1.4.15
      //   plugins: [''],       // 需要使用的的插件列表，如比例尺'AMap.Scale'等
      // }).then((AMap) => {
      //   this.map = new AMap.Map("container", {  // 设置地图容器id
      //     viewMode: "3D",    // 是否为3D地图模式
      //     zoom: 7,           // 初始化地图级别
      //     center: [115.857111, 28.684385], // 初始化地图中心点位置nc:115.857111,28.684385  jj:115.965833,29.663648  jdz:117.204121,29.330187
      //     mapStyle: 'amap://styles/blue',
      //     rotateEnable: false,
      //     pitchEnable: false,
      //     pitch:40,
      //     rotation: 0,
      //     resizeEnable: true
      //   });
      //   // let marker = new AMap.Marker({
      //   //   position: new AMap.LngLat(115.857111, 28.684385),   // 经纬度对象，也可以是经纬度构成的一维数组[116.39, 39.9]
      //   //   title: '南昌'
      //   // });
      //   // let marker2 = new AMap.Marker({
      //   //   position: new AMap.LngLat(115.965833, 29.663648),   // 经纬度对象，也可以是经纬度构成的一维数组[116.39, 39.9]
      //   //   title: '九江'
      //   // });
      //   // let marker3 = new AMap.Marker({
      //   //   position: new AMap.LngLat(117.204121, 29.330187),   // 经纬度对象，也可以是经纬度构成的一维数组[116.39, 39.9]
      //   //   title: '景德镇'
      //   // });
      //   const marker = new AMap.Marker({
      //     position: new AMap.LngLat(117.050277,28.296579),   // 经纬度对象，也可以是经纬度构成的一维数组[116.39, 39.9]
      //     title: '鹰潭'
      //   });
      //   const marker2 = new AMap.Marker({
      //     position: new AMap.LngLat(114.945682,25.829583),   // 经纬度对象，也可以是经纬度构成的一维数组[116.39, 39.9]
      //     title: '赣州'
      //   });
      //   const marker3 = new AMap.Marker({
      //     position: new AMap.LngLat(114.980967,27.123071),   // 经纬度对象，也可以是经纬度构成的一维数组[116.39, 39.9]
      //     title: '吉安'
      //   });
      //
      //   const marker4 = new AMap.Marker({
      //     position: new AMap.LngLat(114.407462,27.827245),   // 经纬度对象，也可以是经纬度构成的一维数组[116.39, 39.9]
      //     title: '宜春'
      //   });
      //   const marker5 = new AMap.Marker({
      //     position: new AMap.LngLat(113.892544,27.6619376),   // 经纬度对象，也可以是经纬度构成的一维数组[116.39, 39.9]
      //     title: '萍乡'
      //   });
      //
      //   // marker.on("mouseout", function (e) {
      //   //     console.log("123");
      //   //     this.visible = false
      //   //     console.log(this.visible);
      //   // })
      //   // 将创建的点标记添加到已有的地图实例：
      //   this.map.add(marker);
      //   this.map.add(marker2);
      //   this.map.add(marker3);
      //   this.map.add(marker4);
      //   this.map.add(marker5);
      //   marker.on("click", (e) => {
      //     this.visible = true
      //   })
      //   this.darwMapBoundary(AMap)
      //   //   let that = this;
      //   //   //添加点击事件
      //   //   this.map.on('click', function (ev) {
      //   //     // 如果存在标记清除标记
      //   //     if (that.marker) {
      //   //       that.map.remove(that.marker);
      //   //     }
      //   //     console.log(ev, "ev")
      //   //     // 获取经纬度
      //   //     var lnglatX = ev.lnglat.lng;
      //   //     var lnglatY = ev.lnglat.lat;
      //   //     // 点击地图添加标记
      //   //     that.marker = new AMap.Marker({
      //   //       position: new AMap.LngLat(lnglatX, lnglatY),   // 经纬度对象，也可以是经纬度构成的一维数组[116.39, 39.9]
      //   //       title: '位置'
      //   //     });
      //   //     // 添加标记
      //   //     that.map.add(that.marker);
      //   //   });
      // }).catch(e => {
      //   console.log(e);
      // })
    },
    // 江西省边界
    darwMapBoundary(AMap) {
      const that = this
      const opts = {
        subdistrict: 1,
        level: 'city',
        extensions: 'all'
      }
      AMap.plugin(
        ['AMap.DistrictSearch', 'AMap.Object3DLayer', 'AMap.Object3D'],
        () => {
          const district = new AMap.DistrictSearch(opts)
          district.search('江西', (status, result) => {
            console.log(status)
            console.log(result)
            if (status === 'complete') {
              const bounds = result.districtList[0].boundaries
              const polygons = []
              for (let i = 0; i < bounds.length; i++) {
                // 生成行政区划polygon
                const polygon = new AMap.Polygon({
                  map: that.map,
                  strokeWeight: 1,
                  path: bounds[i],
                  fillOpacity: 0,
                  fillColor: '#99ffff',
                  strokeColor: '#99ffff'
                })
                polygons.push(polygon)
              }
              that.map.add(polygons)
              that.map.setFitView()

            }
          })
        }
      )
    },
    getMapByYear(){
      return this.$api.kjxm.home.getMapByYear().then(response=>{
        this.mapByYear = this.$eChartFn.getLineChart(Object.keys(response.data),Object.values(response.data));
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    getAllFunding(){
      return this.$api.kjxm.home.getAllFunding().then(response=>{
        this.allFunding.xAxis = Object.keys(response.data)
        this.allFunding.yAxis = Object.values(response.data)
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    getAllProjectCategory(){
      return this.$api.kjxm.home.getAllProjectCategory().then(response=>{
        response.data.forEach(item=>{
          const type = {}
          type.value = item.value
          type.name = item.label
          this.allProjectCategory.push(type)
        })
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    getAllProjectType(){
      return this.$api.kjxm.home.getAllProjectType().then(response=>{
        response.data.forEach(item=>{
          const type = {}
          type.value = item.value
          type.name = item.label
          this.allProjectType.push(type)
        })
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    getProjectList(){
      // 临时数据
      this.projectData = {
        "total": 72,
        "rows": [
          {
            "id": 1675843801139,
            "createTime": "2023-02-08 16:09:53",
            "updateTime": "2023-02-09 17:11:41",
            "createUserId": 1675219542352,
            "updateUserId": 1675219542352,
            "deptId": 1675219156255,
            "tenantId": 1675219156255,
            "searchValue": null,
            "params": {},
            "projectName": "公路建设物资采销过程的信息化管理系统",
            "projectNum": null,
            "waterNum": null,
            "projectLocation": "360600",
            "projectCategory": 1669184546587,
            "projectType": "02",
            "subjectClassification": "10",
            "declareDate": "2023-02-10",
            "keyWord": "信息化管理；物资采销；数据共享；可视化",
            "startDate": "2023-02-10",
            "endDate": "2025-02-10",
            "adviceFunding": 35,
            "subsidyFunding": 10,
            "projectStatus": "1",
            "projectClassify": null,
            "projectCategoryName": "数字交通",
            "declareDeptName": "江西路信建材有限公司",
            "attributeDeptName": null,
            "projectTeam": {},
            "projectLinker": {},
            "projectLeader": {},
            "projectLeaderName": "丁杰栋",
            "reviewType": null,
            "teamName": null,
            "outlineId": null,
            "outlineCompileDate": null,
            "outlineStatus": null,
            "contractId": null,
            "contractNum": null,
            "contractStartDate": null,
            "contractCompleteDate": null,
            "contractDelayDate": null,
            "contractStatus": null,
            "acceptanceId": null,
            "applyType": null,
            "acceptanceDate": null,
            "linker": null,
            "linkerPhone": null,
            "acceptanceStatus": null,
            "projectBackground": {},
            "projectApproach": {},
            "projectBasicstudy": {},
            "projectCompanyList": [],
            "projectMembers": [],
            "projectBudget": {},
            "sysAttMainVo": {},
            "declareYear": null,
            "declareYearCount": null,
            "sysDept": {},
            "sortGroup": null,
            "sysAttMainEntityForSbs": {},
            "approveId": null
          },
          {
            "id": 1676008892117,
            "createTime": "2023-02-10 14:01:28",
            "updateTime": "2023-02-10 14:43:17",
            "createUserId": 1674877705826,
            "updateUserId": 1674877705826,
            "deptId": 1664158364454,
            "tenantId": 1664158364454,
            "searchValue": null,
            "params": {},
            "projectName": "2023210测试项目",
            "projectNum": null,
            "waterNum": "1676018064104",
            "projectLocation": "360900",
            "projectCategory": 1662099020236,
            "projectType": "01",
            "subjectClassification": "01",
            "declareDate": "2023-02-10",
            "keyWord": "Test",
            "startDate": "2023-02-10",
            "endDate": "2023-02-28",
            "adviceFunding": 30,
            "subsidyFunding": 10,
            "projectStatus": "5",
            "projectClassify": null,
            "projectCategoryName": "重大研发专项",
            "declareDeptName": "江西省交通科学研究院有限公司",
            "attributeDeptName": null,
            "projectTeam": {},
            "projectLinker": {},
            "projectLeader": {},
            "projectLeaderName": "Tewe",
            "reviewType": null,
            "teamName": null,
            "outlineId": null,
            "outlineCompileDate": null,
            "outlineStatus": null,
            "contractId": null,
            "contractNum": null,
            "contractStartDate": null,
            "contractCompleteDate": null,
            "contractDelayDate": null,
            "contractStatus": null,
            "acceptanceId": null,
            "applyType": null,
            "acceptanceDate": null,
            "linker": null,
            "linkerPhone": null,
            "acceptanceStatus": null,
            "projectBackground": {},
            "projectApproach": {},
            "projectBasicstudy": {},
            "projectCompanyList": [],
            "projectMembers": [],
            "projectBudget": {},
            "sysAttMainVo": {},
            "declareYear": null,
            "declareYearCount": null,
            "sysDept": {},
            "sortGroup": null,
            "sysAttMainEntityForSbs": {},
            "approveId": null
          },
          {
            "id": 1675388773051,
            "createTime": "2023-02-03 09:46:12",
            "updateTime": "2023-02-09 16:25:34",
            "createUserId": 1675045719468,
            "updateUserId": 1675045719468,
            "deptId": 1664177533098,
            "tenantId": 1664177533098,
            "searchValue": null,
            "params": {},
            "projectName": "预制混凝土桥面板现场连接质量提升技术研究",
            "projectNum": null,
            "waterNum": "1675932817469",
            "projectLocation": "360300",
            "projectCategory": 1669184495650,
            "projectType": "02",
            "subjectClassification": "02",
            "declareDate": "2023-02-09",
            "keyWord": "装配式桥梁、桥面板、钢混组合、湿接缝连接",
            "startDate": "2023-03-02",
            "endDate": "2025-12-31",
            "adviceFunding": 60,
            "subsidyFunding": 15,
            "projectStatus": "2",
            "projectClassify": null,
            "projectCategoryName": "基础设施",
            "declareDeptName": "江西省交通工程集团建设有限公司",
            "attributeDeptName": null,
            "projectTeam": {},
            "projectLinker": {},
            "projectLeader": {},
            "projectLeaderName": "邹玉春",
            "reviewType": null,
            "teamName": null,
            "outlineId": null,
            "outlineCompileDate": null,
            "outlineStatus": null,
            "contractId": null,
            "contractNum": null,
            "contractStartDate": null,
            "contractCompleteDate": null,
            "contractDelayDate": null,
            "contractStatus": null,
            "acceptanceId": null,
            "applyType": null,
            "acceptanceDate": null,
            "linker": null,
            "linkerPhone": null,
            "acceptanceStatus": null,
            "projectBackground": {},
            "projectApproach": {},
            "projectBasicstudy": {},
            "projectCompanyList": [],
            "projectMembers": [],
            "projectBudget": {},
            "sysAttMainVo": {},
            "declareYear": null,
            "declareYearCount": null,
            "sysDept": {},
            "sortGroup": null,
            "sysAttMainEntityForSbs": {},
            "approveId": null
          },
          {
            "id": 1675921906596,
            "createTime": "2023-02-09 13:51:40",
            "updateTime": "2023-02-09 15:00:35",
            "createUserId": 1669257794807,
            "updateUserId": 1669257794807,
            "deptId": 1664158105330,
            "tenantId": 1664158105330,
            "searchValue": null,
            "params": {},
            "projectName": "智能财务转型应用研究-以江西交通企业为例",
            "projectNum": null,
            "waterNum": "1675927291565",
            "projectLocation": "360900",
            "projectCategory": 1669184624421,
            "projectType": "01",
            "subjectClassification": "15",
            "declareDate": "2023-02-09",
            "keyWord": "智能财务、智能化、省级交通设计企业",
            "startDate": "2023-02-10",
            "endDate": "2024-12-31",
            "adviceFunding": 10,
            "subsidyFunding": 5,
            "projectStatus": "2",
            "projectClassify": null,
            "projectCategoryName": "决策支持",
            "declareDeptName": "江西省交通设计研究院有限责任公司",
            "attributeDeptName": null,
            "projectTeam": {},
            "projectLinker": {},
            "projectLeader": {},
            "projectLeaderName": "郭丽",
            "reviewType": null,
            "teamName": null,
            "outlineId": null,
            "outlineCompileDate": null,
            "outlineStatus": null,
            "contractId": null,
            "contractNum": null,
            "contractStartDate": null,
            "contractCompleteDate": null,
            "contractDelayDate": null,
            "contractStatus": null,
            "acceptanceId": null,
            "applyType": null,
            "acceptanceDate": null,
            "linker": null,
            "linkerPhone": null,
            "acceptanceStatus": null,
            "projectBackground": {},
            "projectApproach": {},
            "projectBasicstudy": {},
            "projectCompanyList": [],
            "projectMembers": [],
            "projectBudget": {},
            "sysAttMainVo": {},
            "declareYear": null,
            "declareYearCount": null,
            "sysDept": {},
            "sortGroup": null,
            "sysAttMainEntityForSbs": {},
            "approveId": null
          },
          {
            "id": 1675926209895,
            "createTime": "2023-02-09 15:03:23",
            "updateTime": null,
            "createUserId": 1675843919351,
            "updateUserId": null,
            "deptId": 1670036429118,
            "tenantId": 1670036429118,
            "searchValue": null,
            "params": {},
            "projectName": "基于质量管理的数字化公路设计院平台的开发与应用",
            "projectNum": null,
            "waterNum": null,
            "projectLocation": "360900",
            "projectCategory": 1669184546587,
            "projectType": "03",
            "subjectClassification": "10",
            "declareDate": "2023-02-09",
            "keyWord": "协同设计、文档管理、设校审流程、设计管理平台",
            "startDate": "2023-04-01",
            "endDate": "2025-03-31",
            "adviceFunding": 57.24,
            "subsidyFunding": 30,
            "projectStatus": "1",
            "projectClassify": null,
            "projectCategoryName": "数字交通",
            "declareDeptName": "江西省公路科研设计院有限公司",
            "attributeDeptName": null,
            "projectTeam": {},
            "projectLinker": {},
            "projectLeader": {},
            "projectLeaderName": "黄沙路",
            "reviewType": null,
            "teamName": null,
            "outlineId": null,
            "outlineCompileDate": null,
            "outlineStatus": null,
            "contractId": null,
            "contractNum": null,
            "contractStartDate": null,
            "contractCompleteDate": null,
            "contractDelayDate": null,
            "contractStatus": null,
            "acceptanceId": null,
            "applyType": null,
            "acceptanceDate": null,
            "linker": null,
            "linkerPhone": null,
            "acceptanceStatus": null,
            "projectBackground": {},
            "projectApproach": {},
            "projectBasicstudy": {},
            "projectCompanyList": [],
            "projectMembers": [],
            "projectBudget": {},
            "sysAttMainVo": {},
            "declareYear": null,
            "declareYearCount": null,
            "sysDept": {},
            "sortGroup": null,
            "sysAttMainEntityForSbs": {},
            "approveId": null
          },
          {
            "id": 1675904583460,
            "createTime": "2023-02-09 09:02:54",
            "updateTime": "2023-02-09 19:53:55",
            "createUserId": 1670467704224,
            "updateUserId": 1670467704224,
            "deptId": 1664158069951,
            "tenantId": 1664158069951,
            "searchValue": null,
            "params": {},
            "projectName": "纳米纤维素改性超滤膜对高速公路服务区膜生物反应器的提质增效",
            "projectNum": null,
            "waterNum": null,
            "projectLocation": "360700",
            "projectCategory": 1669184577229,
            "projectType": "04",
            "subjectClassification": "09",
            "declareDate": "2023-02-09",
            "keyWord": "纳米纤维素、超滤膜、高速公路服务区",
            "startDate": "2023-03-30",
            "endDate": "2025-03-31",
            "adviceFunding": 49,
            "subsidyFunding": 40,
            "projectStatus": "1",
            "projectClassify": null,
            "projectCategoryName": "绿色交通",
            "declareDeptName": "江西畅行高速公路服务区开发经营有限公司",
            "attributeDeptName": null,
            "projectTeam": {},
            "projectLinker": {},
            "projectLeader": {},
            "projectLeaderName": "韩峰",
            "reviewType": null,
            "teamName": null,
            "outlineId": null,
            "outlineCompileDate": null,
            "outlineStatus": null,
            "contractId": null,
            "contractNum": null,
            "contractStartDate": null,
            "contractCompleteDate": null,
            "contractDelayDate": null,
            "contractStatus": null,
            "acceptanceId": null,
            "applyType": null,
            "acceptanceDate": null,
            "linker": null,
            "linkerPhone": null,
            "acceptanceStatus": null,
            "projectBackground": {},
            "projectApproach": {},
            "projectBasicstudy": {},
            "projectCompanyList": [],
            "projectMembers": [],
            "projectBudget": {},
            "sysAttMainVo": {},
            "declareYear": null,
            "declareYearCount": null,
            "sysDept": {},
            "sortGroup": null,
            "sysAttMainEntityForSbs": {},
            "approveId": null
          },
          {
            "id": 1675913935586,
            "createTime": "2023-02-09 11:38:52",
            "updateTime": "2023-02-09 17:20:27",
            "createUserId": 1669257677241,
            "updateUserId": 1669257677241,
            "deptId": 1664158105330,
            "tenantId": 1664158105330,
            "searchValue": null,
            "params": {},
            "projectName": "基于BS架构的公路协同设计系统的研究与实现",
            "projectNum": null,
            "waterNum": "1675949907405",
            "projectLocation": "360800",
            "projectCategory": 1669184546587,
            "projectType": "03",
            "subjectClassification": "10",
            "declareDate": "2023-02-09",
            "keyWord": "设计协同、信息化、数据库、B/S架构",
            "startDate": "2023-02-09",
            "endDate": "2025-02-09",
            "adviceFunding": 93,
            "subsidyFunding": 10,
            "projectStatus": "2",
            "projectClassify": null,
            "projectCategoryName": "数字交通",
            "declareDeptName": "江西省交通设计研究院有限责任公司",
            "attributeDeptName": null,
            "projectTeam": {},
            "projectLinker": {},
            "projectLeader": {},
            "projectLeaderName": "吴廷楹",
            "reviewType": null,
            "teamName": null,
            "outlineId": null,
            "outlineCompileDate": null,
            "outlineStatus": null,
            "contractId": null,
            "contractNum": null,
            "contractStartDate": null,
            "contractCompleteDate": null,
            "contractDelayDate": null,
            "contractStatus": null,
            "acceptanceId": null,
            "applyType": null,
            "acceptanceDate": null,
            "linker": null,
            "linkerPhone": null,
            "acceptanceStatus": null,
            "projectBackground": {},
            "projectApproach": {},
            "projectBasicstudy": {},
            "projectCompanyList": [],
            "projectMembers": [],
            "projectBudget": {},
            "sysAttMainVo": {},
            "declareYear": null,
            "declareYearCount": null,
            "sysDept": {},
            "sortGroup": null,
            "sysAttMainEntityForSbs": {},
            "approveId": null
          },
          {
            "id": 1675907473178,
            "createTime": "2023-02-09 09:51:08",
            "updateTime": "2023-02-09 15:31:22",
            "createUserId": 1670467704224,
            "updateUserId": 1670467704224,
            "deptId": 1664158069951,
            "tenantId": 1664158069951,
            "searchValue": null,
            "params": {},
            "projectName": "高速公路服务区综合能源智慧管理系统研究",
            "projectNum": null,
            "waterNum": "1675933409866",
            "projectLocation": "360800",
            "projectCategory": 1669184546587,
            "projectType": "03",
            "subjectClassification": "10",
            "declareDate": "2023-02-09",
            "keyWord": "服务区、能源管理、智慧化",
            "startDate": "2023-03-30",
            "endDate": "2024-09-30",
            "adviceFunding": 62,
            "subsidyFunding": 12,
            "projectStatus": "2",
            "projectClassify": null,
            "projectCategoryName": "数字交通",
            "declareDeptName": "江西畅行高速公路服务区开发经营有限公司",
            "attributeDeptName": null,
            "projectTeam": {},
            "projectLinker": {},
            "projectLeader": {},
            "projectLeaderName": "傅峻",
            "reviewType": null,
            "teamName": null,
            "outlineId": null,
            "outlineCompileDate": null,
            "outlineStatus": null,
            "contractId": null,
            "contractNum": null,
            "contractStartDate": null,
            "contractCompleteDate": null,
            "contractDelayDate": null,
            "contractStatus": null,
            "acceptanceId": null,
            "applyType": null,
            "acceptanceDate": null,
            "linker": null,
            "linkerPhone": null,
            "acceptanceStatus": null,
            "projectBackground": {},
            "projectApproach": {},
            "projectBasicstudy": {},
            "projectCompanyList": [],
            "projectMembers": [],
            "projectBudget": {},
            "sysAttMainVo": {},
            "declareYear": null,
            "declareYearCount": null,
            "sysDept": {},
            "sortGroup": null,
            "sysAttMainEntityForSbs": {},
            "approveId": null
          },
          {
            "id": 1675911778382,
            "createTime": "2023-02-09 11:02:53",
            "updateTime": "2023-02-09 19:51:53",
            "createUserId": 1675843516623,
            "updateUserId": 1675843516623,
            "deptId": 1670036429118,
            "tenantId": 1670036429118,
            "searchValue": null,
            "params": {},
            "projectName": "落石冲击桥墩结构的动力学行为及防护技术研究",
            "projectNum": null,
            "waterNum": null,
            "projectLocation": "360800",
            "projectCategory": 1662021718237,
            "projectType": "02",
            "subjectClassification": "02",
            "declareDate": "2023-02-09",
            "keyWord": "落石 桥墩 冲击 防撞结构 动力特性 钢筋混凝土 承载力",
            "startDate": "2023-03-10",
            "endDate": "2025-03-10",
            "adviceFunding": 48.5,
            "subsidyFunding": 23.5,
            "projectStatus": "1",
            "projectClassify": null,
            "projectCategoryName": "交通安全",
            "declareDeptName": "江西省公路科研设计院有限公司",
            "attributeDeptName": null,
            "projectTeam": {},
            "projectLinker": {},
            "projectLeader": {},
            "projectLeaderName": "赵军",
            "reviewType": null,
            "teamName": null,
            "outlineId": null,
            "outlineCompileDate": null,
            "outlineStatus": null,
            "contractId": null,
            "contractNum": null,
            "contractStartDate": null,
            "contractCompleteDate": null,
            "contractDelayDate": null,
            "contractStatus": null,
            "acceptanceId": null,
            "applyType": null,
            "acceptanceDate": null,
            "linker": null,
            "linkerPhone": null,
            "acceptanceStatus": null,
            "projectBackground": {},
            "projectApproach": {},
            "projectBasicstudy": {},
            "projectCompanyList": [],
            "projectMembers": [],
            "projectBudget": {},
            "sysAttMainVo": {},
            "declareYear": null,
            "declareYearCount": null,
            "sysDept": {},
            "sortGroup": null,
            "sysAttMainEntityForSbs": {},
            "approveId": null
          },
          {
            "id": 1675924926401,
            "createTime": "2023-02-09 14:42:03",
            "updateTime": "2023-02-09 16:27:22",
            "createUserId": 1670467700707,
            "updateUserId": 1670467700707,
            "deptId": 1664183724691,
            "tenantId": 1664183724691,
            "searchValue": null,
            "params": {},
            "projectName": "废轮胎胶粉改性乳化沥青制备及在沥青路面再生应用研究",
            "projectNum": null,
            "waterNum": null,
            "projectLocation": "360900",
            "projectCategory": 1669184495650,
            "projectType": "04",
            "subjectClassification": "01",
            "declareDate": "2023-02-09",
            "keyWord": "SBS定制、温拌、改性沥青、高性能、节能减排",
            "startDate": "2023-02-09",
            "endDate": "2024-12-31",
            "adviceFunding": 80,
            "subsidyFunding": 20,
            "projectStatus": "1",
            "projectClassify": null,
            "projectCategoryName": "基础设施",
            "declareDeptName": "江西省高速公路物资有限公司",
            "attributeDeptName": null,
            "projectTeam": {},
            "projectLinker": {},
            "projectLeader": {},
            "projectLeaderName": "易明",
            "reviewType": null,
            "teamName": null,
            "outlineId": null,
            "outlineCompileDate": null,
            "outlineStatus": null,
            "contractId": null,
            "contractNum": null,
            "contractStartDate": null,
            "contractCompleteDate": null,
            "contractDelayDate": null,
            "contractStatus": null,
            "acceptanceId": null,
            "applyType": null,
            "acceptanceDate": null,
            "linker": null,
            "linkerPhone": null,
            "acceptanceStatus": null,
            "projectBackground": {},
            "projectApproach": {},
            "projectBasicstudy": {},
            "projectCompanyList": [],
            "projectMembers": [],
            "projectBudget": {},
            "sysAttMainVo": {},
            "declareYear": null,
            "declareYearCount": null,
            "sysDept": {},
            "sortGroup": null,
            "sysAttMainEntityForSbs": {},
            "approveId": null
          }
        ],
        "code": 200,
        "msg": "查询成功"
      }
      let projectLocationArray = []
      this.projectData.rows.forEach(item=>{
        projectLocationArray.push(item.projectLocation)
      })
      this.projectData.rows.forEach(item=>{
        if(item.projectLocation=="360800"){
          this.tempProjects.push(item)
          console.log(this.tempProjects)
        }
      })
      projectLocationArray = Array.from(new Set(projectLocationArray))
      projectLocationArray.forEach(item=>{
        this.getList(item)

      })

    },
    getList(code) {
      this.$api.system.location.list({code}).then(response => {
        // this.data = this.handleTree(response.data, "id");
        // this.$refs.table.resetData(this.data);
        // this.dataLoading = false;
        this.localName.push(...response.data)
        console.log(this.localName)
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
  }
}
</script>

<style  scoped>
.project {
  overflow: hidden;
  height: 100%;
  width: 100%;
  position: relative;
}

#container {
  padding: 0px;
  margin: 0px;
  width: 100%;
  height: 87vh;
  overflow: hidden;

}

.pop {
  position: absolute;
  top: 50%;
  right: 50%;
  z-index: 1000;

}

.pie {
  width: 500px;
  position: absolute;
  top: 98px;
  right: 28px;
  z-index: 1000;
  height: 300px;
}

.pie2 {
  width: 300px;
  position: absolute;
  top: 198px;
  right: 28px;
  z-index: 1000;
  height: 300px;
}

.chart {
  width: 300px;
  position: absolute;
  top: 0px;
  right: 0px;
  z-index: 1000;
  padding: 10px;
  /* background: linear-gradient(to left, #000C40, rgba(255, 255, 255, 0.5)); */
  background: linear-gradient(to left, #000C40, rgba(0, 12, 64, 0.3));
  height: 87vh;
  overflow: hidden;
  backdrop-filter: blur(3px);
}

.chart_left {
  width: 300px;
  position: absolute;
  top: 0px;
  left: 0px;
  z-index: 1000;
  padding: 10px;
  background: linear-gradient(to right, #000C40, rgba(0, 12, 64, 0.3));
  /* background: rgba(0, 12, 64, 0.6); */
  height: 87vh;
  overflow: hidden;
  backdrop-filter: blur(3px);
}
::v-deep .t-dialog{
  background-color: rgba(0, 12, 64, 0.7) !important;
  border: none;
  backdrop-filter: blur(3px);
  border: 2px solid rgba(255, 255, 255, 0.8);

}
::v-deep .t-dialog__header{
  color: white;
}
::v-deep .t-dialog__close{
  color: white;
}
::v-deep .t-button--variant-base{
  /* background-color: rgba(0, 12, 64, 0.3) !important; */
  color: white;
}
.projectList{
  color: white;
}
.projectList span{
  display: inline-block;
  width: 33%;
}
.projectList_top{
  margin-bottom: 10px;
  display: flex;
  justify-content: space-evenly;
}
.projectList_center{
  margin-bottom: 10px;
  display: flex;
  justify-content: space-evenly;
}

</style>
